package com.itheima.reggie.utils;

/**
 * ThreadLocal 的工具类
 */
public class BaseContext {

    public  static ThreadLocal<Long>  threadLocal=new ThreadLocal<>();

    /**
     *  将id存入 threadLocal 中
     * @param id
     */
    static public void setId(Long id){
        threadLocal.set(id);
    }

    /**
     * 获取 id的方法
     * @return
     */
   static public Long getId(){
        return threadLocal.get();
    }



}
